package com.itheima.dao;

import com.itheima.bean.Student;
import com.itheima.bean.Studentdb3;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import java.util.List;

public interface StudentDao {

    @Select("select * from studentdb3")
    public  abstract List<Student> selectAllStudent();

    @Select("select * from studentdb3 where id =#{id}")
    public abstract Studentdb3 selectByIdStudent(int id);

    @Insert("insert into studentdb3 values(#{id},#{name},#{age})")
    public abstract Integer insertStudent(Studentdb3 studentdb3);

    @Delete("delete from studentdb3 where id =#{id}")
    public abstract Integer deleteStudent(int id);

    @Update("update studentdb3 set name=#{name} ,age=#{age} where id=#{id}")
    public abstract Integer updateStudent(Studentdb3  studentdb3);
}
